$(function () {
    axios.get(`${host}/blogs`).then((res) => {
        
        let blogs = res.data.data;

        blogs.forEach(item => {
            let html = `
                        <tr class="blog${item.id}">
                                <td>${item.id}</td>
                                <td>${item.title}</td>
                                <td>${item.author}</td>
                                <td>
                                    <input type="button" value="编辑" onclick=btnEdit(${item.id})>
                                    <input type="button" value="删除" onclick=btnDit(${item.id})>
                                </td>
                            </tr>
                        `
            $('tbody').append(html)
        })
    })
})